package monami.application.model.dao;

import java.sql.SQLException;
import java.util.List;
import java.util.Map;

import monami.application.dto.WorkingOperationDTO;

import org.springframework.orm.ibatis.SqlMapClientTemplate;

public class WorkingOperationDAO {
	private SqlMapClientTemplate client;
	
	public WorkingOperationDAO(SqlMapClientTemplate client){
		this.client = client;
	}
	
	public String getDoingWorkorderByWorkorderId(String workorderId) throws SQLException {
		return (String) client.queryForObject("workingOperation.getDoingWorkorderByWorkorderId", workorderId);
	}

	public List<WorkingOperationDTO>getAllLastWorkingOperationByWorkorderId(String workorderId) throws SQLException{
		return (List<WorkingOperationDTO>) client.queryForList("workingOperation.getAllLastWorkingOperationByWorkorderId", workorderId);
	}
	
	public WorkingOperationDTO getLastWorkingOperationByDateAndOperationId(Map map) throws SQLException{
		return (WorkingOperationDTO) client.queryForObject("workingOperation.getLastWorkingOperationByDateAndOperationId", map);
	}
	public void insetWorkoperation(WorkingOperationDTO odto) throws SQLException{
		client.insert("workingOperation.insetWorkoperation", odto);
	}
	public int getWorkingOperationSeq(){
		return (Integer)client.queryForObject("workingOperation.getWorkingOperationSeq");
	}
	
	
}









